var Api = require("../../../api/method.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderid:"",
    headImgUrl:"",
    payUserName: "",
    price:"",
    directPrice: "",
    goodsName: "",
    branchName: "",
    directName: "",
    payTime: "",
    transactionId: "",
    orderId: "",
  },
  Orderdetail:function(e){
    let that = this;
    let list = {
      orderId: that.data.orderid,
      type:2
    };
    console.log(list);
    Api.Orderdetail(list, function (err, res) {
      console.log(res.data);
      if (res.data.code == 1) {
        that.setData({
          headImgUrl:res.data.data.headImgUrl,
          payUserName: res.data.data.payUserName,
          price:res.data.data.price,
          directPrice:res.data.data.directPrice,
          goodsName: res.data.data.goodsName,
          branchName:res.data.data.branchName,
          directName:res.data.data.directName,
          payTime:res.data.data.payTime,
          transactionId: res.data.data.transactionId,
          orderId: res.data.data.orderId
        })
      }
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
    this.setData({
      orderid:options.orderid
    });
    console.log(this.data.orderid)
    this.Orderdetail();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})